package cn.iocoder.yudao.module.member.controller.admin.score.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

/**
 * 用户积分记录 Base VO，提供给添加、修改、详细的子 VO 使用
 * 如果子 VO 存在差异的字段，请不要添加到这里，影响 Swagger 文档生成
 */
@Data
public class ScoreBaseVO {

    @Schema(description = "用户", requiredMode = Schema.RequiredMode.REQUIRED, example = "1836")
    @NotNull(message = "用户不能为空")
    private Long userId;

    @Schema(description = "积分", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "积分不能为空")
    private Long score;

    @Schema(description = "积分等级")
    private String scoreLevel;

    @Schema(description = "积分信息")
    private String scoreInfo;

    @Schema(description = "使用次数")
    private Long number;

    @Schema(description = "积分有效期", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "积分有效期不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime scoreActiveTime;

}
